package file;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-08-07
 * Time: 7:51
 */
public class Demo02 {
    public static void main(String[] args) throws IOException {
        File file = new File("HelloWorld.txt");
        System.out.println( file.exists());//判断文件是否 存在
        System.out.println( file.isDirectory());//判断是否是 路径
        System.out.println( file.isFile()); //判断是否是 文件
        //创建文件
        file.createNewFile();
        //再进行判断
        System.out.println( file.exists());
        System.out.println( file.isDirectory());
        System.out.println( file.isFile());
    }
}
